package erfgame.core.world.terrain.file;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

public class GZIPFileStreamFactory implements FileStreamFactory {

	public InputStream openInputStream(File file) throws IOException {
		return new GZIPInputStream( new BufferedInputStream( new FileInputStream(file) ) );
	}

	public OutputStream openOutputStream(File file) throws IOException {
		return new GZIPOutputStream( new BufferedOutputStream( new FileOutputStream( file ) ) );
	}

}
